UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D3Vr3v2fIWEldgGFswFVZcVgOOqAivQmAokTyMD7sRk=' 
WHERE 
  key_id = '95d92f646a97a77a6b225b4027583b07652ad18fc1a69c07b1725d46ea0e8f17' 
  AND (
    token = 'D3Vr3v2fIWEldgGFswFVZcVgOOqAivQmAokTyMD7sRk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048