UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WqnNfnzgfqe64dhLZ3S5iFYR0Gdx/oKCwR7YISzB6/A='
WHERE
key_id = '09c1ab3d30835cf7082a2038293a28eb7908247b4db82bf2bff4b8c40c7e26db'
AND (
token = 'WqnNfnzgfqe64dhLZ3S5iFYR0Gdx/oKCwR7YISzB6/A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)