UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'arXX5fxj+dNbcHqScO2NNMxt4/qpvYFYuXODR11zg/Q=' 
WHERE 
  key_id = 'cf2e6dd9409a16fa233b5000bf138600a2d9894255cbda34bcced4ce446e0ce2' 
  AND (
    token = 'arXX5fxj+dNbcHqScO2NNMxt4/qpvYFYuXODR11zg/Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040