UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yeAZg1WhrPlbXAvdiCjobfSgLw0igNnWuX92Ri0x1/E=' 
WHERE 
  key_id = '799cd1e2418f80a8ecad9db6ef2e6a2d516b67bc40317b35bad0226ce26b7c62' 
  AND (
    token = 'yeAZg1WhrPlbXAvdiCjobfSgLw0igNnWuX92Ri0x1/E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028