UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'awvgw81x7AIMj+fe6Jh+ftujwisGLTaJh/qG4Uq34c8='
WHERE
key_id = '97d08a26e8e907a14c855eb156cd91ca81bfa91c9a350acb886f4f89f30b5a13'
AND (
token = 'awvgw81x7AIMj+fe6Jh+ftujwisGLTaJh/qG4Uq34c8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)