UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rEOmES8/6A/Di1ryvGeixbSMvw0LoAAuvTZOoHHALgI=' 
WHERE 
  key_id = '657a11860bbfb16345b359d97bbb4b9c5994d20cb362ae8cb34f4179c602aaeb' 
  AND (
    token = 'rEOmES8/6A/Di1ryvGeixbSMvw0LoAAuvTZOoHHALgI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021