UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DNvtUoeHcIVjj3xttkqn8Vg0v61JPeMCwBnO2/FjBHM=' 
WHERE 
  key_id = 'da3808549a5d1f7d2bdfac5ecd6de9e1e671c984659da3ca58f6d3b56061dd94' 
  AND (
    token = 'DNvtUoeHcIVjj3xttkqn8Vg0v61JPeMCwBnO2/FjBHM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025