UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'T/YZHSqacfTk6QQTXTy95xpGyauzbbgJKR1yXcK7Bkg='
WHERE
key_id = 'cd106f18a550fe48d63d01a43eb79038fd9ceca692cff04b81902196ab248287'
AND (
token = 'T/YZHSqacfTk6QQTXTy95xpGyauzbbgJKR1yXcK7Bkg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)