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