UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WDJWul+fXLff/ZnvEJdHml1+VO6/zGKsVf79IVOwfb0='
WHERE
key_id = 'c520b13ba87fcc08615986d1125fca21d8519ad08ee49db56ca9b73d8d7c992a'
AND (
token = 'WDJWul+fXLff/ZnvEJdHml1+VO6/zGKsVf79IVOwfb0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)