UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qSE+YBCglG/YOT7eZSYwg3qJ04wBrJ8e4cyXN9784eA='
WHERE
key_id = '5de205d84bf1aff7e450abb9fba2cf8c03abccc0fa6e3396602d6613670cd166'
AND (
token = 'qSE+YBCglG/YOT7eZSYwg3qJ04wBrJ8e4cyXN9784eA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)