UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sV726/2Q8J+SA4SQBRfJvpLPI99YGs25iu4ohYO0bk4=' 
WHERE 
  key_id = 'be4ab838f8bd5c0bd5d30689c7d2968d9e17cdf26a16b90c7459c9251fdb08e3' 
  AND (
    token = 'sV726/2Q8J+SA4SQBRfJvpLPI99YGs25iu4ohYO0bk4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035