UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wt5dTq/capDtn6EGMnCOctWJAELPRVnMt0P4kebD2lM=' 
WHERE 
  key_id = '4e468291eeda6397a0e6c72cf1471ac3c8408de89080abf9be647d0463c3c723' 
  AND (
    token = 'wt5dTq/capDtn6EGMnCOctWJAELPRVnMt0P4kebD2lM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00234