UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aT408pB80PifimoO1GhQ911or51T9v5O+Oe9TrAwAtA=' 
WHERE 
  key_id = 'e48c9c2f72ea7e4e80599aadb49e7a7fed049f2286469fd58eb2c06241c59a76' 
  AND (
    token = 'aT408pB80PifimoO1GhQ911or51T9v5O+Oe9TrAwAtA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020