UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rhc5qV6ol87iNZwoEL4rT+dJ6pUTkt7Nrhqy4biy5Lo=' 
WHERE 
  key_id = 'a339a8a92377ce9332926b14a3e10aa4b01a9e60bf7a03b7c453a8ccde3ac04c' 
  AND (
    token = 'Rhc5qV6ol87iNZwoEL4rT+dJ6pUTkt7Nrhqy4biy5Lo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045