UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l+HG/J/FpcCid9bvAYfIgZ4i+JhdeGFkjjxHhO1Fc0g='
WHERE
key_id = 'c3c0b96a365012ad22e4e0ab824181ac28190d05a227928fc1c3a9f9c4a1f3d9'
AND (
token = 'l+HG/J/FpcCid9bvAYfIgZ4i+JhdeGFkjjxHhO1Fc0g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)