UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+euUzO9IwKFtYzE0U32xmOoy/BSwe3Z+/KQCpQlz+7Q='
WHERE
key_id = '6ad47771c6f278ea617beb701e1533fcf1c7fc79e00241c383355ae2ed112e9a'
AND (
token = '+euUzO9IwKFtYzE0U32xmOoy/BSwe3Z+/KQCpQlz+7Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)