UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5GLf+hNDeVLKpeWQDTE3evQ8BOkI5V72LVEoDV+5WbE=' 
WHERE 
  key_id = '75189e814373381c1251e25ff8bb5158f100d4951739049ae1e5c3ab89ff8d2c' 
  AND (
    token = '5GLf+hNDeVLKpeWQDTE3evQ8BOkI5V72LVEoDV+5WbE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027