UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IEyWxGS4VY80PDWPktMaR+fS8gh55uGtcUe1J6pYpVI=' 
WHERE 
  key_id = '3b4f936b2d153f5930fc728199b1474166700fe40ad3f5e8c38945f64ee51bf7' 
  AND (
    token = 'IEyWxGS4VY80PDWPktMaR+fS8gh55uGtcUe1J6pYpVI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045