UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1Rou0bd70lRvmQGzmP/q+2CX1lT8y//lXjINOBxv414='
WHERE
key_id = '1bfe99438bb4cfb606135740e716a59fc76079e6aafb26bd2b1d6fe46d67413b'
AND (
token = '1Rou0bd70lRvmQGzmP/q+2CX1lT8y//lXjINOBxv414='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)