UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ho/+tyJsPbZ1VZdWkbG79+gOM9Ebw0UffBBVTb810jw='
WHERE
key_id = 'eaec682091a69aeb6ee140e5b6f5566274dabd6d177250e8b5d6282e3af2d7cd'
AND (
token = 'Ho/+tyJsPbZ1VZdWkbG79+gOM9Ebw0UffBBVTb810jw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)