UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Btqa++/U2YQ5Eh1Z9legZ8ZFgoDPUCVXJG5lTvhqUeA=' 
WHERE 
  key_id = '211985f5fd67b1f62437345f42f7ba2395ca069c242560eafd4caed07b5eb4da' 
  AND (
    token = 'Btqa++/U2YQ5Eh1Z9legZ8ZFgoDPUCVXJG5lTvhqUeA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026