UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LE4q653EF44cbnJieBIFM0k9WOdp3l9Gl9VFINKffIM=' 
WHERE 
  key_id = '053ff2eb416b5f534824462a09221133157c1226fe863056c0c71c99ea9434d8' 
  AND (
    token = 'LE4q653EF44cbnJieBIFM0k9WOdp3l9Gl9VFINKffIM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021