UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zm1yDvw7mwEF+F8/Vfoxi2emfPTP8PkxTbK+gp/M5fI=' 
WHERE 
  key_id = '3070201d4cf608c47f6e28ddb0d9a5b37bc14f3291c05d67f1818f00ce97b3a6' 
  AND (
    token = 'zm1yDvw7mwEF+F8/Vfoxi2emfPTP8PkxTbK+gp/M5fI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028