UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uQD1HoRs2FaGFlLbO4pyiv0YkWufJKzgrMHftMW5z+o=' 
WHERE 
  key_id = '2afd94f9e9d9575d5580d859e4eb2d311da2b0be59bf1117a2cbe2be59db66df' 
  AND (
    token = 'uQD1HoRs2FaGFlLbO4pyiv0YkWufJKzgrMHftMW5z+o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034