UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v8Tr8CbzdI/SCKtjCJb+lUz5DWddmWzRZAK2c5FYZDk='
WHERE
key_id = '5ebca1330c59307b5548278762eec11c6db7b19d05211ae88caf13649634ff6d'
AND (
token = 'v8Tr8CbzdI/SCKtjCJb+lUz5DWddmWzRZAK2c5FYZDk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)