UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8PW/L6n5ZrZnfjGuFzf/EW4FQ492j0oLSkuIB/Nx2b4='
WHERE
key_id = 'e39872e8f83a48eba45dcae70b68ce93fa206b3e95c6ca725821bc8c7c555bef'
AND (
token = '8PW/L6n5ZrZnfjGuFzf/EW4FQ492j0oLSkuIB/Nx2b4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)