UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xo7fc2uYoXeU0zfjFR2x7leyXCkJXqSw+JMlikU2iQk='
WHERE
key_id = '36de6f363d01bb75da3c03eaa06bee739e8c95e6c282a44b91591b003b0e14d7'
AND (
token = 'xo7fc2uYoXeU0zfjFR2x7leyXCkJXqSw+JMlikU2iQk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)