UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nnoRIUbvMTpihhudL2msnqrPTgL9D21T5C7uyA75Ub4=' 
WHERE 
  key_id = '535380c3c7da73e35cea3250e9d6e9a0a30820b3d55d59da30880a6365dcb785' 
  AND (
    token = 'nnoRIUbvMTpihhudL2msnqrPTgL9D21T5C7uyA75Ub4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041