UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5BhNTym8+a0QA3+LAHY0Qxaz3Q8IKuHgOVbbsi+KMl8='
WHERE
key_id = '7ad81b5408ccc1cbd2721ff49513d6236d2beda63860eb1a6ec9b116012c06fd'
AND (
token = '5BhNTym8+a0QA3+LAHY0Qxaz3Q8IKuHgOVbbsi+KMl8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)