UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jqmP4ojlqRdNWWIAN3VdxomNh7M86iBlcIbsY3LrmCY=' 
WHERE 
  key_id = 'b577506007b042c424d369f0f4e4eac444111cf533a5e50878845c1b826aa6fb' 
  AND (
    token = 'jqmP4ojlqRdNWWIAN3VdxomNh7M86iBlcIbsY3LrmCY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052