UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iIhY1yks+YD55J3yljP308bbQllHHhqTnsmIFwuYNaQ=' 
WHERE 
  key_id = '4ff7baa0fea57370ced62abe75107108efa1915c7707abb444e2bcdfd96748f7' 
  AND (
    token = 'iIhY1yks+YD55J3yljP308bbQllHHhqTnsmIFwuYNaQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024