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

Query time 0.00029