UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lfbgeecitnSocbqhZQcTJ7l4aWX3Oi8fr9CdHcw62QM=' 
WHERE 
  key_id = '72d63f95826ae9942ccae9367af48712bdfa535ea53f9190067b6b9e1f369ce3' 
  AND (
    token = 'lfbgeecitnSocbqhZQcTJ7l4aWX3Oi8fr9CdHcw62QM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00083