UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'n5XU/GLE3gISPwY9h1MGFbXRAplXca0tNYAljtSTUl0=' 
WHERE 
  key_id = '23638230139a3f112e5c0f8ba598f61b6e7411ef0687807fa4e77d578de660e4' 
  AND (
    token = 'n5XU/GLE3gISPwY9h1MGFbXRAplXca0tNYAljtSTUl0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029