UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8sk+b/WiTz0KM19o8reHMOf7LWA4YHOY0z/O+dH8ryw=' 
WHERE 
  key_id = '35d044c2a6c6d35919ae64173f1e2675e05ad7b39de6275f22d2d75bf7f986f6' 
  AND (
    token = '8sk+b/WiTz0KM19o8reHMOf7LWA4YHOY0z/O+dH8ryw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030