UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6vfoxg0AkjosbgTcGBXeGP8T6JhpTdIZzaCSuf96YH8=' 
WHERE 
  key_id = 'b70ed96f52a8ebfce27a1db375dee26c82397b5c867c9eeb336cb9fa45456d48' 
  AND (
    token = '6vfoxg0AkjosbgTcGBXeGP8T6JhpTdIZzaCSuf96YH8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027