UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F4KeFc76rizgIvYP+LfIRHKL7HuYdEcEE4rNtb+nR0Q=' 
WHERE 
  key_id = '9dc9f755736faa4c3b2e145d8354d0fd37028aaef85b61b06998bebff7b93d70' 
  AND (
    token = 'F4KeFc76rizgIvYP+LfIRHKL7HuYdEcEE4rNtb+nR0Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030