UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WoRAkcNMOp0jPyLQHcyh4eLi0eS8r+02bosRSszymak=' 
WHERE 
  key_id = '1ee9cf9e19d8d08b8519fb20fb095b3f3a7c0f9ef102979fbbaa35dfdd4390c3' 
  AND (
    token = 'WoRAkcNMOp0jPyLQHcyh4eLi0eS8r+02bosRSszymak=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050