UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zqcERcUgZQcGj6l/4SeBU2wf30VZW42jfliIi3OlTYg=' 
WHERE 
  key_id = 'b928ba41ae52edae5fe0f339d0b7bbbb31fd5889aef7d7812d9fe6264f3114a1' 
  AND (
    token = 'zqcERcUgZQcGj6l/4SeBU2wf30VZW42jfliIi3OlTYg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033