UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LDbhoyHsCHYSRhJXyHzNQv7/86p/JGAWVO5Okxe3xy0='
WHERE
key_id = '8815c988fcd2edef8ee3fb27e1739bbc2e2c11fae109990e93510219bbb521d0'
AND (
token = 'LDbhoyHsCHYSRhJXyHzNQv7/86p/JGAWVO5Okxe3xy0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)