UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hQFzIB72PKh8cz3kTTrMzQz4j1+NnbQfnzXRWcE+bq0=' 
WHERE 
  key_id = '282ac295051605e22198f64d0707065957fe1026d0e5f565a04d9aafeb07336b' 
  AND (
    token = 'hQFzIB72PKh8cz3kTTrMzQz4j1+NnbQfnzXRWcE+bq0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025