UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q+Ez1vJkFZVf5Wmu44t3SQw+QYha6lhL8h10frrRgCk='
WHERE
key_id = '43e942fd51522c3e79964fd4fc64b0cf9a6556b93c00b8f1c6cafa46ff2e418f'
AND (
token = 'Q+Ez1vJkFZVf5Wmu44t3SQw+QYha6lhL8h10frrRgCk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)