UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5XkLCZc/IPhYHMzSKpebBO5InUUhocx+3zmZJl3CXEQ='
WHERE
key_id = '7221216b0245376eaab50231d164e43bf21cdf3c5032d41e9120ac1f0fa83c92'
AND (
token = '5XkLCZc/IPhYHMzSKpebBO5InUUhocx+3zmZJl3CXEQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)