UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vBnx6inSC5S57AB2Cc3kpN+QfF+7L40JlfYOHz9PWc0=' 
WHERE 
  key_id = '1e28f8f46b7ef553c923dd48cc1f69c11de1d39e99194a9947f02bbf8b5e1022' 
  AND (
    token = 'vBnx6inSC5S57AB2Cc3kpN+QfF+7L40JlfYOHz9PWc0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032