UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+LznpmIn7fkgY4nmtXFmJKshihze4pODRC1utNeXee8=' 
WHERE 
  key_id = '16199118e211a5606edf2a044144a0b544d35f075f3c1372ad3f467f328dadab' 
  AND (
    token = '+LznpmIn7fkgY4nmtXFmJKshihze4pODRC1utNeXee8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047