UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AWae0tWqHA28adx+PuBQ6efNbGayvlmhHIgYhVaqruk=' 
WHERE 
  key_id = '77de1ada8d98910e54eb6c25ebb0d6d9ea59876eb1e85a6bbd46f96b9774d8e9' 
  AND (
    token = 'AWae0tWqHA28adx+PuBQ6efNbGayvlmhHIgYhVaqruk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032