UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0tKtm1yS1WpEaCPaHIkxVDEpSOc8pDa3Q4asbcjkf5E='
WHERE
key_id = '99994075a3d4f2047a46ff522558b0290987b9ecb8c6ca27abb43b51423f83a5'
AND (
token = '0tKtm1yS1WpEaCPaHIkxVDEpSOc8pDa3Q4asbcjkf5E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)