UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RAfAVG3c2lycp8lhhcyxuzGt1xdQl4VlR4boortaLiA=' 
WHERE 
  key_id = 'ccd352722efaa645552cc9a156979f1c6ee577154e10da1dbe9ab03a9cd67d9b' 
  AND (
    token = 'RAfAVG3c2lycp8lhhcyxuzGt1xdQl4VlR4boortaLiA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019