UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dVf7sF2uEXflQOzULTCpBTd8Wxv+MW/zt6PHWe1drnU=' 
WHERE 
  key_id = '5328eb0f75b29bd52f79d8dfc19a0944daef857c47352a2ff61e1b2dec1214c5' 
  AND (
    token = 'dVf7sF2uEXflQOzULTCpBTd8Wxv+MW/zt6PHWe1drnU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037