UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8c+Ue4Mrqx5QGzYy6N2MlM1VzUUpHnhKymc93PkKwz8=' 
WHERE 
  key_id = '76cd1d8f0ab786c15166befb782d6e8d8129738f97d103278eb1099401371f63' 
  AND (
    token = '8c+Ue4Mrqx5QGzYy6N2MlM1VzUUpHnhKymc93PkKwz8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030