UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zs2Bc7PZWE72gT21dskn4E8k1S6b2kfWbZ8N56NFDMI='
WHERE
key_id = 'cbf2123cdceb9bfbcd6d67bc18371b05f0953abbdbe4e9a7f6f98baa81e08a85'
AND (
token = 'zs2Bc7PZWE72gT21dskn4E8k1S6b2kfWbZ8N56NFDMI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)