UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HNQ8QQ4VKthkh5pNMdE1zyuOdhks25qB5Rf2BEzVufo=' 
WHERE 
  key_id = '2d8f83cf437f73852c1f4e3b82ffabed0625badc6c389cf29c61a524ac419830' 
  AND (
    token = 'HNQ8QQ4VKthkh5pNMdE1zyuOdhks25qB5Rf2BEzVufo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036