UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hKkmnAUe+u09VZhaibUByf/3fJyMUVumAsHGyXt4AW0='
WHERE
key_id = 'bd0d155247f791793c10f51752b71294ef3d2e58cc25271448a6c4cf3615fc94'
AND (
token = 'hKkmnAUe+u09VZhaibUByf/3fJyMUVumAsHGyXt4AW0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)