UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Tr6pte1a+yZlw8u2ejNhyPzF90uJj7G8FoGV3d2zC/w='
WHERE
key_id = '85c46eec087181804dde10e252221ce4a399bdb966f8681c2467879c630a8e2a'
AND (
token = 'Tr6pte1a+yZlw8u2ejNhyPzF90uJj7G8FoGV3d2zC/w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)