UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LCV0UHbYt4CjLfU8Q4Wfp6XNVgl+TYIA3sYhFk2J0XI='
WHERE
key_id = '786fd0b3747b0a755cfec2bfe3c7c721de6a90f1fff986a6a8525c653713a744'
AND (
token = 'LCV0UHbYt4CjLfU8Q4Wfp6XNVgl+TYIA3sYhFk2J0XI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)