UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rAiALW75kWzGDB2UpD9/Y0JbA/9e59GSoCgwI4LNFHk=' 
WHERE 
  key_id = '637a8f7176a2c9b1309cd884775bc8db7849818d726ffd9752e7359508f5caae' 
  AND (
    token = 'rAiALW75kWzGDB2UpD9/Y0JbA/9e59GSoCgwI4LNFHk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026